place_snapped

语法:

place_snapped(hsnap, vsnap);


参数 描述
hsnap The horizontal snapping to check.
vsnap The vertical snapping to check.


返回: 布尔值


描述

With this function you can check and see if the origin of an instance (its x and y position) is aligned to a grid with the hsnap and vsnap values specified by you.


例如:

with (obj_Pieces)
   {
   if !place_snapped(32, 32)
      {
      move_snap(32, 32);
      }
   }

The above code checks all instances of "obj_Pieces" to see if they are snapped to a grid of 32x32 pixels, and if they are not it snaps them to the nearest position in that grid.